<?php
/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 2018/10/24
 * Time: 8:31
 */

namespace app\admin\model;


use think\Model;

class Category extends Model
{
    protected $table = 'k_goods_category';

    public function getItemAttr($value)
    {
        return model("Category")->field("id,name,is_hot as isHot,image")->where(["pid" => $value, "is_show" => 1])->order("sort_order", "desc")->select();
    }

    public function getImageAttr($value)
    {
        return "http://img.huaxiaoujia.com/" . $value;
    }
}